package cn.itsource.org.dto;

import cn.itsource.common.domain.BaseDomain;
import cn.itsource.org.domain.Wxuser;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

/**
 * 实体类：
 */
@Data
public class WxuserDto{
    private String openid;
    private String nickname;
    private Integer sex;
    private String headimgurl;
    private String unionid;
    private Long userId;

    private String city;
    private String province;
    private String country;

    public static Wxuser WxuserDtoToWxuser(WxuserDto wxuserDto){
        Wxuser wxuser = new Wxuser();
        BeanUtils.copyProperties(wxuserDto,wxuser);
        wxuser.setAddress(wxuserDto.getCountry()+" "+wxuserDto.getProvince()+" "+wxuserDto.getCity());
        return wxuser;
    }
}
